<template>
  <div class="home">
    <h1>第六种组件传值的方法$attrs+$listener</h1>
    <child-b :msg="msg" @handler="handler" />
  </div>
</template>

<script>
// @ is an alias to /src
import childB from "@/components/childB.vue";

export default {
  data() {
    return {
      msg: "这是父组件的变量要传给 组件c",
    };
  },
  name: "HomeView",
  components: {
    childB,
  },
  methods: {
    handler(val) {
      console.log("这是祖父的方法" + val);
    },
  },
};
</script>
